/*
 * Copyright 2024-2025 the original author or authors.
 */

package io.modelcontextprotocol.sdk;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Weather information data model.
 *
 * @author MCP Java SDK Example
 */
public class WeatherInfo {

	private final String city;

	private final String country;

	private final double temperature;

	private final double feelsLike;

	private final int humidity;

	private final double pressure;

	private final String condition;

	private final String description;

	private final double windSpeed;

	private final double visibility;

	public WeatherInfo(String city, String country, double temperature, double feelsLike, int humidity, double pressure,
			String condition, String description, double windSpeed, double visibility) {
		this.city = city;
		this.country = country;
		this.temperature = temperature;
		this.feelsLike = feelsLike;
		this.humidity = humidity;
		this.pressure = pressure;
		this.condition = condition;
		this.description = description;
		this.windSpeed = windSpeed;
		this.visibility = visibility;
	}

	public String getCity() {
		return city;
	}

	public String getCountry() {
		return country;
	}

	public double getTemperature() {
		return temperature;
	}

	@JsonProperty("feels_like")
	public double getFeelsLike() {
		return feelsLike;
	}

	public int getHumidity() {
		return humidity;
	}

	public double getPressure() {
		return pressure;
	}

	public String getCondition() {
		return condition;
	}

	public String getDescription() {
		return description;
	}

	@JsonProperty("wind_speed")
	public double getWindSpeed() {
		return windSpeed;
	}

	public double getVisibility() {
		return visibility;
	}

	@Override
	public String toString() {
		return String.format(
				"Weather in %s, %s:\n" + "Temperature: %.1f°C (feels like %.1f°C)\n" + "Condition: %s (%s)\n"
						+ "Humidity: %d%%\n" + "Pressure: %.1f hPa\n" + "Wind Speed: %.1f m/s\n"
						+ "Visibility: %.1f km",
				city, country, temperature, feelsLike, condition, description, humidity, pressure, windSpeed,
				visibility);
	}

}
